
   // var facilities = ["北京市",'江苏省连云港市','南京市','江苏省大丰市','江苏省淮安市','山东省青岛市','广州市','上海市','浙江省杭州市'];
   // var comlanoes = ["安阳市",'南京市','北京市','南宁市','西安市','拉萨市','广州市','西宁市','上海市'];
   // var hospltals = ["安阳市",'南京市','北京市','南宁市','西安市','拉萨市','广州市','西宁市','上海市'];
   // var nonpharma = ["安阳市",'南京市','北京市','南宁市','西安市','拉萨市','广州市','西宁市','上海市'];
   // var overseas = ["安阳市",'南京市','北京市','南宁市','西安市','拉萨市','广州市','西宁市','上海市'];


   var MapData = null;
   var Mapdefault = [];
   var mapIconInd = 1;

   var map = null;
   var markerOne = null;

   var icon =  new AMap.Icon({            
              size: new AMap.Size(19, 33),  //图标大小
              image: 'images/mapicon/mark_bs.png',
              imageSize:new AMap.Size(19, 33),
              imageOffset: new AMap.Pixel(0, 0),
              // offset: new AMap.Pixel(-15, -5),
            })


// 地图加载

function BusinessMapFun(string){
  var MapThisDa = MapData[string]
  map = new AMap.Map('BusinessMap', {
   resizeEnable: true,
   lang:'cn',
   zoom:5,
   center: [108.824032,34.167488],
   scrollWheel:false


 });
 		// map.setMapStyle("dark"); //设置地图的样式

    AMap.plugin(['AMap.ToolBar','AMap.Scale','AMap.OverView','AMap.Geolocation','AMap.MapType'],
      function(){
        map.addControl(new AMap.ToolBar());

        // map.addControl(new AMap.Scale());

        // map.addControl(new AMap.Geolocation());
        
        // map.addControl(new AMap.MapType());

        // map.addControl(new AMap.OverView({isOpen:true}));
      });

    markerOne = new AMap.Marker({
     icon:icon,
     position: [116.388806,39.904462],
     // offset: new AMap.Pixel(-5, -35)

   });
    markerOne.setMap(map);


   //map.clearMap();  // 清除地图覆盖物



    clearSetMap(MapThisDa)




}





  // BusinessMapFun();

// 地图加载  end

function SetMapFun(string){
  var MapThisDa = MapData[string]
    clearSetMap(MapThisDa)

}



function clearSetMap(MapThisDa){
  map.clearMap();  // 清除地图覆盖物
  markerOne.setMap(map);
   for (var i = 0; i < MapThisDa.length; i++) {

    geocoder(MapThisDa[i].name) 
  }
}

function geocoder(data) {
  var geocoder = new AMap.Geocoder({
           // city: "010", //城市，默认：“全国”
            radius: 1000 //范围，默认：500
          });
        //地理编码,返回地理编码结果
        geocoder.getLocation(data, function(status, result) {
          // console.log(result)
          if (status === 'complete' && result.info === 'OK') {
            addMarker(result.geocodes[0],data);
            // console.log(result)
          }
        });
      }


      function addMarker(data,namu) {
        var marker = new AMap.Marker({
          map: map,
          position: [ data.location.getLng(),  data.location.getLat()],
          title:namu,
          icon: icon ,
          // animation:'AMAP_ANIMATION_BOUNCE',
          // offset: new AMap.Pixel(-15, -10)


        });

        map.setFitView();

      }